package com.yand.data.queue;

import java.util.concurrent.ArrayBlockingQueue;

public class QueueTest {

    public static void main(String [] args){
        /*Queue queue = new Queue(4);
        System.out.println("是否空了==>"+queue.isEmpty());
        queue.insertQueue(2l);
        queue.insertQueue(3l);
        queue.insertQueue(4l);
        queue.insertQueue(5l);
        System.out.println("是否满了==>"+queue.isFull());

        System.out.println("出列的元素为==>"+queue.removeQueue());
        System.out.println("出列的元素为==>"+queue.removeQueue());
        System.out.println("出列的元素为==>"+queue.removeQueue());
        System.out.println("出列的元素为==>"+queue.removeQueue());

        System.out.println("是否空了==>"+queue.isEmpty());
        queue.insertQueue(5l);
        queue.insertQueue(6l);
        queue.insertQueue(7l);
        System.out.println("是否空了==>"+queue.isEmpty());
        System.out.println("是否满了==>"+queue.isFull());*/

        ArrayBlockingQueue queue = new ArrayBlockingQueue(4);
        try {
            queue.put(2l);
            queue.put(3l);
            queue.put(4l);
            queue.put(5l);
            System.out.println("是否满了==>"+queue.isEmpty());

            System.out.println("出列的元素为==>"+queue.peek());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
